﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Converter="clr-namespace:ReferenceTemplate.WindowsPhone.Converter"
    x:Class="ReferenceTemplate.WindowsPhone.Views.DetailPage"
    DataContext="{Binding Source={StaticResource Locator}, Path=Main}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">

	<phone:PhoneApplicationPage.Resources>
		<Converter:ConvertImagePath x:Key="ConvertImagePath"/>
	</phone:PhoneApplicationPage.Resources>
	<phone:PhoneApplicationPage.ApplicationBar>
		<shell:ApplicationBar>
			<shell:ApplicationBarIconButton x:Name="PinToStart" IconUri="/Assets/AppBar/favs.addto.png"  Text="Anclar al inicio" Click="PinToStart_Click" />
            <shell:ApplicationBarIconButton x:Name="CopyLink" IconUri="/Assets/AppBar/copy.png" IsEnabled="True" Text="Copiar" Click="CopyLink_Click"/>
            <shell:ApplicationBarIconButton x:Name="OpenLink" IconUri="/Assets/AppBar/open.png" IsEnabled="True" Text="Abrir" Click="OpenLink_Click"/>
		</shell:ApplicationBar>
	</phone:PhoneApplicationPage.ApplicationBar>
	<phone:PhoneApplicationPage.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</phone:PhoneApplicationPage.FontFamily>
	<phone:PhoneApplicationPage.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</phone:PhoneApplicationPage.FontSize>
	<phone:PhoneApplicationPage.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</phone:PhoneApplicationPage.Foreground>
<!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot">
        <Grid.Background>
            <ImageBrush Stretch="UniformToFill" ImageSource="{Binding Background, Converter={StaticResource ConvertImagePath}}"/>
        </Grid.Background>
        <Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>

		<!--TitlePanel contains the name of the application and page title-->
        <StackPanel Grid.Row="0"  Background="#CC000000">
            <TextBlock Text="{Binding AppName}" Margin="20,17,0,5" Style="{StaticResource PhoneTextNormalStyle}" Foreground="White"/>
            <TextBlock HorizontalAlignment="Left" TextWrapping="NoWrap" Margin="20,0,0,10" TextTrimming="WordEllipsis" Style="{StaticResource PhoneTextNormalStyle}"  Text="{Binding SelectedLink.Title}" VerticalAlignment="Top" FontSize="26.667" Foreground="White"/>
		</StackPanel>

        <!--ContentPanel - place additional content here-->
		<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"/>
		<phone:WebBrowser Grid.Row="1" Source="{Binding SelectedLink.URL}"/>
	</Grid>

</phone:PhoneApplicationPage>